const rem = require('../../config/rem.config')

const size = parseFloat(rem.size / rem.rate)

module.exports = `
// config/rem.config.js 配置
function remTransformer(){
  var deviceWidth = window.innerWidth || document.body.clientWidth || document.documentElement.clientWidth
  document.getElementsByTagName('html')[0].style.fontSize = deviceWidth / ${size} + 'px'
}
remTransformer()
window.addEventListener('resize', remTransformer)
`
